var mongoose = require("mongoose");

//草稿表(draft)

var draftSchema = new mongoose.Schema({
  title: {
    type: String
  }, //标题
  titleImageUrl: {
    type: String
  }, //题图URL
  html: {
    type: String
  }, //文章富文本
  deleImgId: {
    type: Array,
    default: []
  }, //需要删除的图片
  textReplace: {
    type: String
  }, //文章缩略
  deletTitleImageUrl: {
    type: Array,
    default: []
  }, //需要删除的题图图片
  userId: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "user_login"
  },
  radio1: {
    type: String
  }, //类别选择
  editTime: {
    type: Date,
    default: new Date()
  },
  problemData: {
    type: Object,
    default: {}
  }, //回答标题
  fileList: {
    type: Array,
    default: []
  }, //附件列表
  fileDelectArr: {
    type: Array,
    default: []
  }, //附件删除
  classify: {
    type: String,
    default: ''
  }, //资源类型
  shareArticle: [{
    title: String,
    url: String
  }] //分享文章
});

module.exports = mongoose.model("draft", draftSchema);